﻿using System;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.nodes.snowflake;

namespace SharpSqlAnalyzer.stmt.snowflake
{
	// Token: 0x020000ED RID: 237
	public class TCopyIntoStmt : TCustomSqlStatement
	{
		// Token: 0x06000808 RID: 2056 RVA: 0x00301756 File Offset: 0x002FF956
		public TCopyIntoStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstCopyInto;
		}

		// Token: 0x06000809 RID: 2057 RVA: 0x0030176A File Offset: 0x002FF96A
		public void setTableName(TObjectName tableName)
		{
			this.tableName = tableName;
		}

		// Token: 0x0600080A RID: 2058 RVA: 0x00301773 File Offset: 0x002FF973
		public void setSubQuery(TSelectSqlStatement subQuery)
		{
			this.subQuery = subQuery;
		}

		// Token: 0x0600080B RID: 2059 RVA: 0x0030177C File Offset: 0x002FF97C
		public TObjectName getTableName()
		{
			return this.tableName;
		}

		// Token: 0x0600080C RID: 2060 RVA: 0x00301784 File Offset: 0x002FF984
		public TSelectSqlStatement getSubQuery()
		{
			return this.subQuery;
		}

		// Token: 0x0600080D RID: 2061 RVA: 0x0030178C File Offset: 0x002FF98C
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			TCopyIntoNode tcopyIntoNode = (TCopyIntoNode)this.rootNode;
			this.tableName = tcopyIntoNode.TableName;
			if (tcopyIntoNode.Subquery != null)
			{
				this.subQuery = new TSelectSqlStatement(this.dbvendor);
				this.subQuery.rootNode = tcopyIntoNode.Subquery;
				this.subQuery.doParseStatement(this);
			}
			return 0;
		}

		// Token: 0x0600080E RID: 2062 RVA: 0x003017FB File Offset: 0x002FF9FB
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x0600080F RID: 2063 RVA: 0x0030180B File Offset: 0x002FFA0B
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x040011FC RID: 4604
		private TObjectName tableName;

		// Token: 0x040011FD RID: 4605
		private TSelectSqlStatement subQuery;
	}
}
